﻿/* DotNetHoldem 
 * .Net Solution that allows to use OpenHoldem with .Net logic
 * Author: Óscar Andreu
 * oesido at gmail dot com
 * Licensed under GPLv3 - 2012
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DotNetBotLogic.Controllers;
using DotNetBotLogic.Enums;
using DotNetBotLogic.Classes.Log;

namespace DotNetBotLogic.Classes.BetRoundClasses.NL6Max
{
    internal class SwagPreflopNL6 : BetRoundBase
    {
        #region Variables

        private PositionsNL6 dealPosition;
        //The meaning is that lists 10x goes till 106
        private KeyValuePair<string, int> list10x = new KeyValuePair<string, int>("islist10", 6);

        #endregion

        #region Constructor

        internal SwagPreflopNL6(BaseController ctrl)
            :base(ctrl)
        {
            this.ctrl = ctrl;
            dealPosition = (PositionsNL6)OhHelper.GetSymbol(Symbols.dealposition);
        }

        #endregion

        #region Private

        private double Round1NoOponentsRaising()
        {
            double lResult = 0;

            if (dealPosition == PositionsNL6.Button || dealPosition == PositionsNL6.SmallBlind || dealPosition == PositionsNL6.BigBlind)
            {
                if (IsInLists(list10x, 3))
                {
                    lResult = 2.5;
                    Logger.Log("swag -- list103-list106 Button 2.5 bb");
                }
            }
            else if (dealPosition == PositionsNL6.Cutoff)
            {
                if (IsInLists(list10x, 4))
                {
                    lResult = 3;
                    Logger.Log("swag -- list104-list106 Cutoff 3 bb");
                }
            }
            else if (dealPosition == PositionsNL6.MiddlePosition)
            {
                if (IsInLists(list10x, 5))
                {
                    lResult = 3.5;
                    Logger.Log("swag -- list105-list106 MiddlePosition 3.5 bb");
                }
            }
            else if (dealPosition == PositionsNL6.UTG)
            {
                if (IsInLists(list10x, 6))
                {
                    lResult = 4;
                    Logger.Log("swag -- list106-list106 UTG 4 bb");
                }
            }

            return BaseController.BBlind * lResult;
        }

        private double Round1OneOponentsRaising()
        {
            return 0;
        }

        #endregion

        #region Overrrides

        internal override double getAction()
        {
            if (ctrl.BetTurn == 1)
            {
                if (NumberOpponentsRaisingPreflop() == 0)
                {
                    actionResult = Round1NoOponentsRaising();
                }
                else if (NumberOpponentsRaisingPreflop() == 1)
                {
                    actionResult = Round1OneOponentsRaising();
                }
            }
            
            return actionResult; ;
        }

       

         #endregion
        
    }
}
